package com.job.action;

import com.job.dao.ResumeDao;
import com.job.model.Resume;
import com.job.model.User;
import com.job.service.ResumeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;

import javax.servlet.http.HttpSession;

/**
 *
 * 显示个人简历
 * @author hasee
 */
@Controller
public class ShowMyResume {
    private ResumeService resumeService;

    @RequestMapping("/resume.do")
    public String showResume(Model model , HttpSession session){
        User user= (User) session.getAttribute("user");
     Resume resume=    resumeService.getFirstResume(user.getUserId());
     if (resume!=null){
         model.addAttribute("resume",resume);
     }
     model.addAttribute("user",user);
     return "resume";
    }

    @Autowired
    public void setResumeService(ResumeService resumeService) {
        this.resumeService = resumeService;
    }
}
